package com.lancoo.ccas53.pojo.common;

/**
 * @Author: liufeng
 * @CreateTime: 2023-12-18  15:08
 * @Description:
 */
public enum HourType {

    //    0:环节  1讲授 2实验 3上机 4其他
    LECTURE(1, "讲授"),
    EXPERIMENTAL(2, "实验"),
    COUMPUTER(3, "上机"),
    OTHER(4, "其他"),
    Segment(0, "环节");

    private int code;
    private String msg;

    HourType(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static HourType getByCode(int code) {
        for (HourType value : HourType.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
